package com.project.service.impl;

import com.project.bean.CutPageBean;
import com.project.bean.ProductBean;
import com.project.dao.IProductDao;
import com.project.dao.impl.ProductDaoImpl;
import com.project.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDate;
@Service
public class ProductServiceImpl implements ProductService {
    @Autowired
    private IProductDao dao;
    @Override
    public CutPageBean<ProductBean> findByItem(int pageNo, String name, LocalDate startDate, LocalDate endDate) {
        return dao.findByItem(pageNo,name,startDate,endDate);
    }

    @Override
    public ProductBean findById(Integer id) {
        return dao.findById(id);
    }

    @Override
    public void update(Integer id, Integer price) {
dao.update(id,price);
    }

    @Override
    public void del(Integer id) {
        dao.del(id);
    }

    @Override
    public void add(ProductBean productBean) {
dao.add(productBean);
    }

}
